package com.xzzz.irda.auth.core.authorization;

import com.xzzz.irda.auth.core.token.AccessToken;

import java.util.Date;
import java.util.List;

/**
 * 授权对象抽象类
 *
 * @author wangyf
 * 
 */
public class AbstractAuthorization implements Authorization {

    private String grantType;
    private String clientId;
    private AccessToken token;
    private List<String> permissions;

    private Long expire;
    private Long expireTime;
    private Long duration;
    private Date loginDateTime;

    private Boolean requestRefresh;

    @Override
    public String getGrantType() {
        return grantType;
    }

    @Override
    public void setGrantType(String grantType) {
        this.grantType = grantType;
    }

    @Override
    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    @Override
    public String getClientId() {
        return clientId;
    }

    @Override
    public Long getExpire() {
        return expire;
    }

    @Override
    public void setExpire(Long expire) {
        this.expire = expire;
    }

    @Override
    public Long getExpireTime() {
        return expireTime;
    }

    @Override
    public void setExpireTime(Long expireTime) {
        this.expireTime = expireTime;
    }

    @Override
    public Long getDuration() {
        return duration;
    }

    @Override
    public void setDuration(Long duration) {
        this.duration = duration;
    }

    @Override
    public Date getLoginDateTime() {
        return loginDateTime;
    }

    @Override
    public void setLoginDateTime(Date loginDateTime) {
        this.loginDateTime = loginDateTime;
    }

    @Override
    public Boolean getRequestRefresh() {
        return requestRefresh;
    }

    @Override
    public void setRequestRefresh(Boolean requestRefresh) {
        this.requestRefresh = requestRefresh;
    }

    @Override
    public AccessToken getAccessToken() {
        return token;
    }

    @Override
    public void setAccessToken(AccessToken token) {
        this.token = token;
    }

    @Override
    public List<String> getPermissions() {
        return permissions;
    }

    @Override
    public void setPermissions(List<String> permissions) {
        this.permissions = permissions;
    }


    @Override
    public String toString() {
        return "AbstractAuthorization{" +
                "grantType=" + grantType +
                ", platFormCode='" + clientId + '\'' +
                ", token=" + token +
                ", permissions=" + permissions +
                ", expire=" + expire +
                ", expireTime=" + expireTime +
                ", duration=" + duration +
                ", loginDateTime=" + loginDateTime +
                ", requestRefresh=" + requestRefresh +
                '}';
    }
}
